/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.servinf.ani.sincronizador.entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author mortiz
 */
@Entity
@Table(name = "estado_intervencion", catalog = "ani_admin", schema = "public")
@NamedQueries({
    @NamedQuery(name = "EstadoIntervencion.findAll", query = "SELECT e FROM EstadoIntervencion e")})
public class EstadoIntervencion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_estado_interv")
    private Integer idEstadoInterv;
    @Column(name = "nombre_estado_intervencion")
    private String nombreEstadoIntervencion;
    @OneToMany(mappedBy = "estadoIntervencion")
    private List<Intervencion> intervencionList;

    public EstadoIntervencion() {
    }

    public EstadoIntervencion(Integer idEstadoInterv) {
        this.idEstadoInterv = idEstadoInterv;
    }

    public Integer getIdEstadoInterv() {
        return idEstadoInterv;
    }

    public void setIdEstadoInterv(Integer idEstadoInterv) {
        this.idEstadoInterv = idEstadoInterv;
    }

    public String getNombreEstadoIntervencion() {
        return nombreEstadoIntervencion;
    }

    public void setNombreEstadoIntervencion(String nombreEstadoIntervencion) {
        this.nombreEstadoIntervencion = nombreEstadoIntervencion;
    }

    public List<Intervencion> getIntervencionList() {
        return intervencionList;
    }

    public void setIntervencionList(List<Intervencion> intervencionList) {
        this.intervencionList = intervencionList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idEstadoInterv != null ? idEstadoInterv.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EstadoIntervencion)) {
            return false;
        }
        EstadoIntervencion other = (EstadoIntervencion) object;
        if ((this.idEstadoInterv == null && other.idEstadoInterv != null) || (this.idEstadoInterv != null && !this.idEstadoInterv.equals(other.idEstadoInterv))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.servinf.ani.sincronizador.entities.EstadoIntervencion[ idEstadoInterv=" + idEstadoInterv + " ]";
    }
    
}
